<?php
    
    require_once "initazure.php";
    use WindowsAzure\Common\ServicesBuilder;
    use WindowsAzure\Common\ServiceException;
    use WindowsAzure\Table\Models\Entity;
    use WindowsAzure\Table\Models\EdmType;
    $filter = "RowKey eq '1'";

    try {
        $tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString);
        $result = $tableRestProxy->queryEntities("myproduct");
    } catch(ServiceException $e){
        $code = $e->getCode();
        $error_message = $e->getMessage();
        echo $code.": ".$error_message."<br />";
    }

    $entities = $result->getEntities();

    foreach($entities as $entity){        
        echo $entity->getPartitionKey().":".$entity->getRowKey()."<br />";
        echo "ProductName: ".$entity->getPropertyValue("ProductName")."<br />";
        echo "CreateDate: ".$entity->getPropertyValue("CreateDate")->format('Y-m-d H:i:s')."<br />";
    }
?>
